package cn.clazz.extendss

/**
  * Created by lzd on 2018/9/5.
  */
abstract class AbstractDemo(name:String) {
  def sysHello:Unit
}

class StudentDemo(name: String) extends AbstractDemo(name){
  //在子类中覆盖抽象类的抽象方法时，不需要使用override关键字
  def sysHello:Unit = println("hello"+name)
}

object StudentDemo{
  def main(args: Array[String]): Unit = {
    val li = new StudentDemo("Li")
    li.sysHello
  }
}
